home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / lib / pm-utils / sleep.d / 49bluetooth < prev    next >
Text File  |  2009-10-06  |  664b  |  36 lines

  1. #!/bin/sh
  2. # IBM specific hack to disable/enable bluetooth.
  3. # TODO: Doesn't the working USB suspend/resume functionality
  4. #       make this code more or less obsolete?
  5.  
  6. . "${PM_FUNCTIONS}"
  7.  
  8. [ -f /proc/acpi/ibm/bluetooth ] || exit $NA
  9.  
  10. suspend_bluetooth()
  11. {
  12.     if grep -q enabled /proc/acpi/ibm/bluetooth; then
  13.         savestate ibm_bluetooth enable
  14.         echo disable > /proc/acpi/ibm/bluetooth
  15.     else
  16.         savestate ibm_bluetooth disable
  17.     fi
  18. }
  19.  
  20. resume_bluetooth()
  21. {
  22.     state_exists ibm_bluetooth || return
  23.     restorestate ibm_bluetooth > /proc/acpi/ibm/bluetooth
  24. }
  25.  
  26. case "$1" in
  27.     hibernate|suspend)
  28.         suspend_bluetooth
  29.         ;;
  30.     thaw|resume)
  31.         resume_bluetooth
  32.         ;;
  33.     *) exit $NA
  34.         ;;
  35. esac
  36.